1. Field of the Invention
The invention relates to a network interface apparatus called a router or the like which is provided in a network system and relays a transmission of a data packet as a bundle of information.
2. Description of the Related Art
Hitherto, in a network system, a network interface apparatus for relaying a transmission of a data packet which is transmitted and received in the network existed.
FIG. 5 is a diagram showing an example of a network system.
A network system 10 is constructed by: a network interface apparatus 11 having three ports (ports 1, 2, and 3) for inputting and outputting a data packet; LANs (Local Area Networks) 1, 2, and 3 connected to the ports 1, 2, and 3; and a number of terminals A to J connected to any one of the ports via any one of the LANs 1, 2, and 3. Among those many terminals, the terminals A to C are connected to the port 1, the terminals D to G are connected to the port 2, and the terminals H to J are connected to the port 3, respectively.
In case of transmitting a data packet from the terminal A to the terminal D, the data packet transmitted from the terminal A serving as a transmitting source is inputted from the port 1 to the network interface apparatus 11 via the LAN 1. The network interface apparatus 11 knows that the terminal D serving as a receiving destination is the terminal connected to the port 2 from a receiving destination address in the data packet, and generates the data packet from the port 2 to the LAN 2.
The terminal D knows that the data packet is a data packet to be received by itself from the receiving destination address in the data packet sent via the LAN 2, and receives the data packet. The data packet is transmitted and received in this manner.
Because of a problem on safety of data communication and blocking a broadcast packet, in recent years, an idea of VLAN (Virtual LAN) has been used. The VLAN is a logical LAN defined as a group capable of communicating at a position away from the physical LANs 1, 2, and 3 connected to the ports 1, 2, and 3. For example, in a configuration shown in FIG. 5, it is assumed that the terminals A, B, D, E, and F surrounded by a broken line construct one VLAN labeled as VLAN1, the terminals D, E, H, I, and J surrounded by an alternate long and short dash line construct one VLAN labeled as VLAN2, and the terminals C, E, F, G, and J surrounded by a dotted line construct one VLAN labeled as VLAN3, respectively. As shown in this example, it is also permitted that one terminal belongs to a plurality of VLANs.
FIG. 6 is a diagram showing relations among the terminals and the VLANs shown in FIG. 5.
In the example shown here, the terminals A and B belong to only the VLAN1, the terminals H and I belong to only the VLAN2, the terminals C and G belong to only the VLAN3, the terminal D belongs to the VLAN1 and VLAN2, the terminal J belongs to the VLAN2 and VLAN3, the terminal F belongs to the VLAN3 and VLAN1, and the terminal E belongs to the VLAN1, VLAN2, and VLAN 3, respectively.
Corresponding relations among addresses of the terminals, VLAN IDs of the VLANs to which the respective terminals belong, and port IDs of the ports to which the terminals are connected have been recorded in the network interface apparatus 11. When a data packet is inputted to the network interface apparatus 11, the network interface apparatus knows whether the terminal of the transmitting source and the terminal of the receiving destination belong to the same VLAN or not by referring to a transmitting source address and a receiving destination address of the data packet. When they belong to the same VLAN, the data packet is transmitted from the port to which the receiving destination terminal is connected.
FIG. 7 is a diagram showing an example of a VLAN control table showing the corresponding relation among the addresses of the terminals, the VLAN IDs of the VLANs to which the terminals belong, and the port IDs of the ports to which the terminals are connected in the network interface apparatus.
In the diagram, the addresses (MAC addresses) of the terminals, the VLAN IDs to identify the VLANs to which the terminals belong, and the port IDs to identify the ports to which the terminals are connected are simply stored as a table.
For example, the terminal (terminal A) of an MAC address A belongs to the VLAN1 and is connected to the destination of the port 1. The terminal (terminal D) of an MAC address D belongs to the VLAN1 and VLAN2 and is connected to the destination of the port 2. The terminal (terminal E) of an MAC address E belongs to the VLAN1, VLAN2, and VLAN3 and is connected to the destination of the port 2.
A case where, for instance, the terminal J belonging to the VLAN2 and VLAN3 becomes a transmitting source and transmits the data packet to the terminal F belonging to the VLAN1 and VLAN3 will now be considered. Since the terminals J and F belong to the common VLAN, namely, VLAN3, communication can be performed between the terminals J and F.
In this case, the network interface apparatus 11 first knows that the terminal J belongs to the VLAN2 from the transmitting source address J in the inputted data packet, knows that the terminal F belongs to the VLAN1 from the receiving destination address F in the data packet, and compares the VLAN2 and VLAN1. Since they do not coincide here, subsequently, the network interface apparatus 11 knows that the terminal F belongs to the VLAN3 and compares the VLAN2 of the terminal J with the VLAN3 of the terminal F. Since they also do not coincide here, the network interface apparatus 11 knows that the terminal J belongs to the VLAN3, knows that the terminal F belongs to the VLAN1, and compares the VLAN3 and VLAN1. Since they do not coincide here, the network interface apparatus 11 knows that the terminal F also belongs to the VLAN3 and compares the VLAN3 and VLAN3. Since they coincide now, the network interface apparatus 11 knows that the inputted data packet can be also transmitted to the terminal F, and sends the data packet to the port 2 to which the terminal F is connected. In this manner, whether the transmitting source terminal and the receiving destination terminal belong to the same VLAN or not is known with reference to the table shown in FIG. 7. When they belong to the same VLAN, the data packet can be transmitted to the receiving destination terminal. However, it is necessary to successively compare as mentioned above in order to know whether the transmitting source terminal and the receiving destination terminal belong to the same VLAN or not. When each terminal belongs to a number of VLANs, such a method of finding the common VLAN by the successive comparison has problems such that it needs a long time and a communicating speed is reduced.
FIG. 8 is a diagram showing another corresponding method among the addresses (MAC addresses) of the terminals and the VLANs to which the terminals belong.
In this instance, a bit arrangement of a length of the maximum number (n+1) of VLANs is provided every MAC address (each terminal) and each VLAN is allocated to each bit in a manner such that the VLAN1 is allocated to bit 0, the VLAN2 is allocated to bit 1, and the VLAN3 is allocated to bit 2.
For example, a bit arrangement of (n+1) bits corresponding to the MAC address A (terminal A) is shown in FIG. 8(a). The diagram shows that only bit 0 is set to "1" and all of the other bits are set to "0", so that the terminal A belongs to only the VLAN1. Similarly, a bit arrangement of (n+1) bits corresponding to the MAC address D (terminal D) is shown in FIG. 8(b). Since bit 0 and bit 1 are set to "1" and the other bits are set to "0", it will be understood that the terminal D belongs to the VLAN1 and VLAN2. Further, a bit arrangement of (n+1) bits corresponding to the MAC address E (terminal E) is shown in FIG. 8(c). Since bit 0 to bit 2 are set to "1" and the other bits are set to "0", it will be understood that the terminal E belongs to the VLAN1, VLAN2, and VLAN3.
In a case where information indicating to which VLAN each terminal belongs is provided as a format of such a bit arrangement, with respect to the bit arrangement corresponding to the transmitting source terminal and the bit arrangement corresponding to the receiving side terminal, the AND operation is done every corresponding bit and the OR operation is done with regard to the whole AND operation result of every corresponding bit. It will be understood that when the OR calculation result, consequently, is equal to logic "1", the transmitting source terminal and the receiving side terminal belong to the same VLAN and that when the OR calculation result is equal to logic "0", they do not belong to the same VLAN. In other words, in case of the format of the bit arrangement as shown in FIG. 8, the successive comparison is unnecessary and whether the transmitting source terminal and the receiving side terminal belong to the same VLAN or not can be known by the simple calculations and the high speed communication can be performed.
In case of the format shown in FIG. 8, however, since the bit arrangement is needed every terminal, a very large memory capacity is necessary. On the other hand, since the bit arrangement of the same length as the maximum number of VLANs is necessary, there is a problem such that if the maximum number of VLANs is estimated to be small, the apparatus lacks expandability and, if the maximum number of VLANs is estimated to be large, a memory of a further extremely large capacity is needed.